package kr.hkit.powerjava.chapter06;

import java.util.Scanner;

public class WhileEx2_1 {
	public static void main(String[] args) {
		int x;
		int y;
		
		System.out.println("두개의 정수를 입력하시오 : (큰수 , 작은수)");
		
		Scanner input = new Scanner(System.in);
		
		x=input.nextInt();
		y=input.nextInt();
		

		
		calGcd(x,y);
	}

	private static void calGcd(int x,int y) {
		int r=0;
		
		while(y!=0){
			r=x%y;
			x=y;
			y=r;
		}
		System.out.println("최대 공약수는" + x + "입니다.");		
	}

}
